package com.yonyou.cyxdms.sysAuth.service.dto;

import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.dto.base.DMSBaseDTO;
import com.yonyou.cyx.framework.bean.entity.base.BasePO;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeDeserializer;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeSerializer;


/**
 * <p>
 * 组织关系表
 * </p>
 *
 * @author 李贺
 * @since 2019-09-18
 */

public class TrOrgDTO extends DMSBaseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 组织关系ID
     */
        private Long relationId;
        /**
     * 组织ID
     */
        private Long orgId;
        /**
     * 上级ID
     */
        private Long parentOrgId;
        /**
     * 上端下发数据ID
     */
        private Long sourceId;
        /**
     * 上端下发数据日期
     */
        @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime sourceChangedAt;
            private Integer isDeleted;
    
    public TrOrgDTO() {
        super();
    }




    public Long getRelationId() {
        return relationId;
    }


    public void setRelationId(Long relationId) {
        this.relationId = relationId;
    }



    public Long getOrgId() {
        return orgId;
    }


    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }



    public Long getParentOrgId() {
        return parentOrgId;
    }


    public void setParentOrgId(Long parentOrgId) {
        this.parentOrgId = parentOrgId;
    }



    public Long getSourceId() {
        return sourceId;
    }


    public void setSourceId(Long sourceId) {
        this.sourceId = sourceId;
    }



    public LocalDateTime getSourceChangedAt() {
        return sourceChangedAt;
    }


    public void setSourceChangedAt(LocalDateTime sourceChangedAt) {
        this.sourceChangedAt = sourceChangedAt;
    }



    public Integer getIsDeleted() {
        return isDeleted;
    }


    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }



    @Override
    public String toString() {
        return "TrOrgDTO{" +
        "relationId=" + relationId +
        ", orgId=" + orgId +
        ", parentOrgId=" + parentOrgId +
        ", sourceId=" + sourceId +
        ", sourceChangedAt=" + sourceChangedAt +
        ", isDeleted=" + isDeleted +
        "}";
    }
    /**
     * 将DTO 转换为PO
     * //对某个对象属性进行赋值
     * //BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     * @param poClass dto 需要转换的dto
     * @author 李贺
     * @since 2018/7/22 0022
     */
    @Override
    public <T extends BasePO> T transDtoToPo(Class<T> poClass) {
        return super.transDtoToPo(poClass);
    }

    /**
     * 将DTO 转换为PO
     * BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     * @param po 需要转换的对象
     * @author 李贺
     * @since 2018/7/22 0022
     */
    public <T extends BasePO> void transDtoToPo(T po) {
        BeanMapperUtil.copyProperties(this, po, "relationId");
    }

}
